﻿@namespace BootstrapBlazor.Components
@inherits BootstrapComponentBase

<a @attributes="@AdditionalAttributes" class="@ClassString">
    <i class="@GetIconString"></i>
    <span class="text">@Item.Text</span>
    <i class="fa fa-angle-down nav-link-right"></i>
    <ul class="nav sub-menu">
        @foreach (var item in Item.Items)
        {
            <li class="@GetClassString(item)">
                @if (item.Items.Any() && !item.IsDisabled)
                {
                    <SubMenu Item="@item" OnClick="OnClickItem" />
                }
                else
                {
                    <div class="nav-item" @onclick:stopPropagation @onclick="() => OnClickItem(item)">
                        <MenuLink Item="@item" />
                    </div>
                }
            </li>
        }
    </ul>
</a>
